/**
 */
package org.xtext.ic.dsl.icDsl.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import org.xtext.ic.dsl.icDsl.Flags;
import org.xtext.ic.dsl.icDsl.IcDslPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Flags</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.xtext.ic.dsl.icDsl.impl.FlagsImpl#isId <em>Id</em>}</li>
 *   <li>{@link org.xtext.ic.dsl.icDsl.impl.FlagsImpl#isAutoid <em>Autoid</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class FlagsImpl extends MinimalEObjectImpl.Container implements Flags
{
  /**
   * The default value of the '{@link #isId() <em>Id</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isId()
   * @generated
   * @ordered
   */
  protected static final boolean ID_EDEFAULT = false;

  /**
   * The cached value of the '{@link #isId() <em>Id</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isId()
   * @generated
   * @ordered
   */
  protected boolean id = ID_EDEFAULT;

  /**
   * The default value of the '{@link #isAutoid() <em>Autoid</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isAutoid()
   * @generated
   * @ordered
   */
  protected static final boolean AUTOID_EDEFAULT = false;

  /**
   * The cached value of the '{@link #isAutoid() <em>Autoid</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isAutoid()
   * @generated
   * @ordered
   */
  protected boolean autoid = AUTOID_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected FlagsImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return IcDslPackage.Literals.FLAGS;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public boolean isId()
  {
    return id;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setId(boolean newId)
  {
    boolean oldId = id;
    id = newId;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, IcDslPackage.FLAGS__ID, oldId, id));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public boolean isAutoid()
  {
    return autoid;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setAutoid(boolean newAutoid)
  {
    boolean oldAutoid = autoid;
    autoid = newAutoid;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, IcDslPackage.FLAGS__AUTOID, oldAutoid, autoid));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case IcDslPackage.FLAGS__ID:
        return isId();
      case IcDslPackage.FLAGS__AUTOID:
        return isAutoid();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case IcDslPackage.FLAGS__ID:
        setId((Boolean)newValue);
        return;
      case IcDslPackage.FLAGS__AUTOID:
        setAutoid((Boolean)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case IcDslPackage.FLAGS__ID:
        setId(ID_EDEFAULT);
        return;
      case IcDslPackage.FLAGS__AUTOID:
        setAutoid(AUTOID_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case IcDslPackage.FLAGS__ID:
        return id != ID_EDEFAULT;
      case IcDslPackage.FLAGS__AUTOID:
        return autoid != AUTOID_EDEFAULT;
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (id: ");
    result.append(id);
    result.append(", autoid: ");
    result.append(autoid);
    result.append(')');
    return result.toString();
  }

} //FlagsImpl
